from django.db import models

# Create your models here.
class User(models.Model):
    phone=models.CharField(verbose_name="用户名",max_length=15,unique=True)
    email=models.CharField(verbose_name="密码",max_length=32,unique=True)
    money=models.IntegerField(verbose_name="余额",default=0)
    password = models.CharField(verbose_name="密码", max_length=32)

    def __str__(self):
        return self.email

    class Meta:
        db_table="my_user"
        verbose_name="用户表"
        verbose_name_plural=verbose_name
        ordering=["phone"]


#利用中间件获取访问的链接和时间
class FunCount(models.Model):
    url=models.CharField(max_length=20)
    count=models.IntegerField(default=0)
    data=models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.url

    class Meta:
        db_table="func_count"

